var bMap;
export default () => {
    return bMap ? Promise.resolve(bMap) : new Promise((resolve, reject) => {
        var scriptNode = document.getElementsByTagName('script')[0];
        scriptNode.parentNode.insertBefore(
            Object.assign(document.createElement('script'), {
                src: 'http://api.map.baidu.com/getscript?v=3.0&ak=nw1UmSkHYuT3amwlrdznQhEn',
                type: 'text/javascript',
                async: true,
                onload: () => resolve(bMap = BMap)
            }),
            scriptNode
        );
    });
}
